<?php session_start();$_SESSION['page'] = 'library';?>
<?php
    $libraryNo = $_GET['libraryNo'];

    
    require('db_connection.php');
    $query = "SELECT * FROM tbllibrary where libraryNo=".$libraryNo."";
    $result = mysql_query($query);
    while ($row = mysql_fetch_array($result))
    {
        $libraryName = $row['libraryName'];
        $address = $row['address'];
        $contactNo = $row['contactNo'];
        $imgfilename = $row['imgfilename'];
        $description = $row['description'];
    }
?>

<!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html>

   <head>
      <title>Library Edit</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000" class=''>

    <?php 
    echo "<form method='post' action='editedlibrary.php?page=library&libraryNo=$libraryNo' enctype='multipart/form-data'name='form1' id='form1'>";
    ?>
    <table width='80%' align='center' class='content'>
        <tr><td colspan='2'><img src='images/banner.jpg'></td></tr>
            <tr><td align='right' colspan='2' class='logout'><?php require ('loginout.php');?></td></tr>
            <tr class='menuborder'><td width='90%'><img src='images/editlib.png'></td><td><?php  require('buttons.php'); ?></td></tr>
            <tr><td colspan='2' class='bodyborder'>
            <table width='70%' align='center'>
                <tr><td height='30'></td></tr>
                <tr><td>Library Name/Municipality</td>
                <?php
                  echo "<td><input type='text' name='libraryName' value ='$libraryName' size='45'/></td></tr>";
                echo "<tr><td>Address</td>";
                  echo "<td><input type='text' value='$address' name='address' size='45'/></td></tr>";
                echo "<tr><td>Contact No</td>";
                  echo "<td><input type='text' value='$contactNo' name='contactNo' size='45'/></td></tr>";
                echo "<tr><td>Brief Description/History of the Library</td>";
                echo "<td><textarea value='$description' name='description' size='45' rows='4' cols='34'>$description</textarea></td></tr>";
                ?>
                <tr><td>Browse Picture</td><td><input name="ufile" type="file" id="ufile" size="45" /></td></tr>
                <tr><td height='15'></td></tr>
                <tr><td colspan='3' align='right'><input type='submit' value='Update' class='tool'></td></tr>
            </table>
            </td>
        </tr>
        <tr><td align='center' colspan='2'><?php require ('copyright.php')?></td></tr>
    </table>
    </form>

   </body>
</html>

